<?php
    include_once ("MySql.php");
    
    class AnularDA extends dal{
        public function AnularDA(){
            parent::dal();
        }
        public function anular($entity){
            $sql = "CALL SGISI_ANULAR('$entity->ID_MULTA',"
                    ."'$entity->ANIO')";
            
            $result = parent::execute($sql);
//            echo $sql;
            if($result){
                return true;
            }else{
                return false;
            }
        }
        public function buscar($cum,$anio,$actividad){
            $sql = "CALL SGISS_CUENTA_CUM('$cum','$anio','$actividad')";
            $result = parent::execute($sql);
//            echo $sql;
            while($fila = mysqli_fetch_object($result)){
                $num_row= $fila->resultado;
            }
            return $num_row;
        }
        public function buscarDetalle($cum){
            $sql = "CALL SGISS_BUSCAR_DETALLE('$cum')";
            $result = parent::execute($sql);
            $obj = "";
            while ($fila = mysqli_fetch_object($result)){
                $obj .= "|".$fila->ID_MULTA_DETAL."| ";
            }
            return $obj;
        }
    }
?>
